package com.menhai.personmanagement.services;

import com.menhai.personmanagement.entity.TjProposal;
import com.menhai.personmanagement.mapper.TjProposalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author shikun
 * @since 2022-01-17
 */

 @Service
public class ITjProposalService{

    @Autowired
    private TjProposalMapper tjProposalMapper;


    public int addProposal(TjProposal tjProposal, String hosnum, int userid){
        tjProposal.setHosnum(hosnum);
        tjProposal.setUserid(userid);
        return tjProposalMapper.insert(tjProposal);
    }

    public List allProposal(){
        return tjProposalMapper.selectList(null);
    }

    public int editProposal(TjProposal tjProposal){
        return tjProposalMapper.updateById(tjProposal);
    }

    public int delProposal(TjProposal tjProposal){
        return tjProposalMapper.deleteById(tjProposal);
    }
}
